package com.daily.daily_push.config;

import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.util.ClientBuilder;
import io.kubernetes.client.util.KubeConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.FileReader;
import java.io.IOException;

//@Configuration
public class K8sYamlConfig {
//    @Bean
    public ApiClient apiClient() throws IOException {
        ApiClient client = ClientBuilder.kubeconfig(KubeConfig.loadKubeConfig(new FileReader("D:\\commonTest\\k8s\\config.yaml"))).build();
        io.kubernetes.client.openapi.Configuration.setDefaultApiClient(client);
        return client;
    }

}
